package Demo1;


import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class T24 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> blockingQueue = new ArrayBlockingQueue<>(100);//容量为100
        blockingQueue.put("aaaa");//入队列
        String take = blockingQueue.take();//出队列
        System.out.println(take);
        String take1 = blockingQueue.take();
        System.out.println(take1);//此时打印就会 堵塞
    }
}